put

inline suspend fun <VALUE : Any> DataCache.put(item: VALUE, ttl: Duration): Unit?

Inserts a new expiring item into the cache for ttl. Inserting an entry with an id that is already present will cause the old value to be overwritten.


inline suspend fun <VALUE : Any> DataCache.put(vararg items: VALUE, ttl: Duration): Unit?

Inserts new expiring items into the cache for ttl. Inserting an entry with an id that is already present will cause the old value to be overwritten.


inline suspend fun <VALUE : Any> DataCache.put(item: VALUE, until: Instant, clock: Clock = Clock.System): Unit?

Inserts a new item into the cache until it expires. Inserting an entry with an id that is already present will cause the old value to be overwritten.

Parameters

clock

the Clock to use to look up the current time

Throws


inline suspend fun <VALUE : Any> DataCache.put(vararg items: VALUE, until: Instant, clock: Clock = Clock.System): Unit?

Inserts new items into the cache until it expires. Inserting an entry with an id that is already present will cause the old value to be overwritten.

Parameters

clock

the Clock to use to look up the current time

Throws